package cn.tedu.backend.portal.mapper;

import cn.tedu.backend.portal.model.Season;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SeasonMapper extends BaseMapper<Season> {
     //查询季节对应景点
    @Select("select * from season")
    List<Season> selectSeasons();

    //删除季节
  @Delete("delete from season where season=#{season}")
  int delSeason(String season);

  //增加季节
  @Insert("insert into season values(#{season},#{sid})")
  int addSeason(Season season);

  //修改季节
  @Update("update season set season=#{season},sid=#{sid} where season=#{season}")
  int updateSeason(Season season);

  //根据季节名查询
  @Select("select * from season where season like CONCAT('%',#{season},'%')")
  Season searchSeason(String season);
//    //查询所有
//    @Select("select * from event")
//    List<Season> selectAll();
//
//    //删除信息
//    @Delete("delete from event where id=#{id}")
//    int deleteById(int id);
//
//    //通过用户id查询该用户参加的活动
////    @Select("select activity_title,activity_details,activity_img,activity_address,activity_city,activity_time " +
////            "from event where activity_id in (select activity_id from user_activity where user_id=#{userId})")
//
//    @Select("select activity_title,activity_details,activity_img,activity_address,activity_city,activity_time " +
//            "from event where activity_id in (select activity_id from user_activity where user_id='kk@qq.com')")
////    List<Event> userEventsById(String userId);
//    List<Season> userEventsById();
//
//    //发布者发布过的活动
////    @Select("select activity_title,activity_details,activity_img,activity_address,activity_city,activity_time \n" +
////            "from event \n" +
////            "where user_id=#{userId}")
//    @Select("select activity_title,activity_details,activity_img,activity_address,activity_city,activity_time \n" +
//            "from event where user_id='sfsfs@qq.com'")
////    List<Event> sendEventsById(String userId);
//    List<Season> sendEventsById();
}
